#!/usr/bin/python
# -*- coding: utf-8 -*-

#This file is part of pyLot library.
#
# pyLot is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyLot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with pyLot.  If not, see <http://www.gnu.org/licenses/>.

__author__ = u'Pierre Puiseux, Guillaume Baty'
__copyright__ = u"Copyright 2011-2012 (C) andheo, Université de Pau et des Pays de l'Adour"
__credits__ = [u'Pierre Puiseux', u'Guillaume Baty']
__license__ = "GNU Lesser General Public License"

"""
Provides a dictionary of QTextCharFormat
"""

__date__ = "26 avr. 2010"
__author__ = "INRIA pyLot"
__all__ = [
  u'PYLOT_CHAR_FORMATS',
  u'PYLOT_CHAR_FORMAT_STD',
  u'PYLOT_CHAR_FORMAT_TITLE',
  u'PYLOT_CHAR_FORMAT_WARN',
  u'PYLOT_CHAR_FORMAT_INFO',
  u'font_fixed'
  ]

from Qt4.QtGui import QTextCharFormat, QBrush, QColor, QFont
from Qt4.QtCore import Qt

PYLOT_CHAR_FORMATS = {}

font_fixed = QFont()
font_fixed.setPointSize(9)
font_fixed.setStyleHint(QFont.TypeWriter)

PYLOT_CHAR_FORMAT_STD = QTextCharFormat()
PYLOT_CHAR_FORMAT_STD.setForeground(Qt.black)
PYLOT_CHAR_FORMAT_STD.setBackground(QBrush(QColor(255, 255, 255, 0)))
PYLOT_CHAR_FORMAT_STD.setFontFamily(u'Mono')
PYLOT_CHAR_FORMATS[u'std'] = PYLOT_CHAR_FORMAT_STD

PYLOT_CHAR_FORMAT_TITLE = QTextCharFormat()
PYLOT_CHAR_FORMAT_TITLE.setForeground(QBrush(QColor(0, 0, 255, 255)))
PYLOT_CHAR_FORMAT_TITLE.setBackground(QBrush(QColor(255, 255, 255, 0)))
PYLOT_CHAR_FORMATS[u'title'] = PYLOT_CHAR_FORMAT_TITLE

PYLOT_CHAR_FORMAT_WARN = QTextCharFormat()
PYLOT_CHAR_FORMAT_WARN.setForeground(QBrush(QColor(255, 0, 0, 255)))
PYLOT_CHAR_FORMAT_WARN.setBackground(QBrush(QColor(255, 255, 255, 0)))
PYLOT_CHAR_FORMATS[u'warn'] = PYLOT_CHAR_FORMAT_WARN

PYLOT_CHAR_FORMAT_INFO = QTextCharFormat()
PYLOT_CHAR_FORMAT_INFO.setForeground(QBrush(QColor(0, 0, 0, 255)))
PYLOT_CHAR_FORMAT_INFO.setBackground(QBrush(QColor(255, 255, 255, 0)))
PYLOT_CHAR_FORMATS[u'info'] = PYLOT_CHAR_FORMAT_INFO

if __name__ == '__main__':
  import doctest
  doctest.testmod()


